<template>
	<view class="content">
		<picker mode="date" @change="dateChange" class="picker-region" start="1900-01-01" :value="pickerValue" end="2000-01-01">
			<view class="pick-data" v-if="!pickerValue">请选择日期</view>
			<view class="pick-data" v-else>
				{{pickerValue}}
			</view>
		</picker>
		<!-- #ifdef MP-WEIXIN -->
		<picker mode="region" @change="regionChange" class="picker-region" :value="regionData">
			<view class="pick-data" v-if="regionData.length===0">请选择城市</view>
			<view class="pick-data" v-else>
				{{regionData.join(' ')}}
			</view>
		</picker>
		<!-- #endif -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				regionData: ['天津市','天津市','和平区'],
				pickerValue:'1999-12-08'
			}
		},
		computed: {
			formateCurrentData() {
				const cDate = new Date()
				return cDate
			}
		},
		onLoad() {

		},
		methods: {
			dateChange(e) {
				this.pickerValue = e.detail.value
				console.log('dateChange',e.detail)
			},
			regionChange(e){
				this.regionData = e.detail.value
				console.log('regionChange',e.detail)
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		
	}
	.picker-region {
		
		padding: 20rpx;
		border-radius: 10rpx;
		border: 1rpx solid #c6c6c6;
		margin-top: 20rpx;
	}
</style>
